package com.ebelter.scalebledemo;

import android.app.Application;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.util.Log;

import com.ebelter.scaleblesdk.ScaleBleManager;
import com.ebelter.scaleblesdk.util.ULog;



public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        //ULog默认级别为MODE_DEBUG，关闭ULog日志打印，可设置logMode为MODE_PRODUCT
//        ULog.setLogMode(ULog.MODE_PRODUCT);

        getVersion();

    }
    private void getVersion(){
        PackageManager pm=getPackageManager();
        try{
            PackageInfo info=pm.getPackageInfo(getPackageName(),0);
            String versionName=info.versionName;
            int versionCode=info.versionCode;
            Log.i("MyApplication","-----minSdkVersion="+info.applicationInfo.minSdkVersion);
            Log.i("MyApplication","-----targetSdkVersion="+info.applicationInfo.targetSdkVersion);
        }catch (Exception e){
            e.printStackTrace();
        }

    }

}
